package cn.damai.search.baseService.ipml;

import cn.damai.model.Area;
import cn.damai.search.mapper.AreaMapper;
import cn.damai.search.baseService.BaseAreaService;
import cn.damai.util.DubboUtil;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Component
@Service(version = DubboUtil.VRESION,group = DubboUtil.GROUP)
public class BaseAreaServiceIpml implements BaseAreaService {

    @Autowired
    private AreaMapper areaMapper;

    @Override
    public Area getAreaById(@RequestParam("id")Long id){
        return areaMapper.getAreaById(id);
    }

    @Override
    public List<Area>	getAreaListByMap(@RequestParam Map<String,Object> param){
        return areaMapper.getAreaListByMap(param);
    }

    @Override
    public Integer getAreaCountByMap(@RequestParam Map<String,Object> param){
        return  areaMapper.getAreaCountByMap(param);
    }

    @Override
    public Integer qdtxAddArea(@RequestParam Area Area){
        Area.setCreatedTime(new Date());
        return areaMapper.insertArea(Area);
    }

    @Override
    public Integer qdtxModifyArea(@RequestParam Area Area){
        Area.setUpdatedTime(new Date());
        return areaMapper.updateArea(Area);
    }


}
